import { View, Text, Image } from '@tarojs/components';

import oldCardImg from '@/assets/images/user/icon/old-card@2x.png';
import addressImg from '@/assets/images/user/icon/address@2x.png';
import activityImg from '@/assets/images/user/icon/activity@2x.png';
import privacyImg from '@/assets/images/user/icon/privacy@2x.png';
import setingImg from '@/assets/images/user/icon/setting@2x.png';
import Taro from '@tarojs/taro';

import './style.scss';

const cardList = [
  {
    img: oldCardImg,
    title: '养老卡绑定',
    path: '/subPages/oldCard/index',
  },
  {
    img: addressImg,
    title: '地址管理',
    path: '/subPages/address/index',
  },
  {
    img: activityImg,
    title: '我的活动',
    path: '/subPages/myActivity/index',
  },
  {
    img: privacyImg,
    title: '隐私政策',
    path: '/subPages/agreement/index?type=privacy'
  },
  // {
  //   img: setingImg,
  //   title: '设置',
  //   path: '/subPages/setting/index',
  // },
];
/**
 * 更多设置
 * @returns
 */
const MoreSetting = () => {
  const clickSettingItem = (path) => {
    path &&
      Taro.navigateTo({
        url: path,
      });
  };
  return (
    <View className="more-setting-wrap">
      {cardList.map((item, index) => (
        <View onClick={() => clickSettingItem(item?.path)} key={index} className="setting-item">
          <Image mode="aspectFill" src={item.img} />
          <Text>{item.title}</Text>
        </View>
      ))}
    </View>
  );
};
export default MoreSetting;
